from django.conf.urls.defaults import *
from lvproject.jj97.views import *
from lvproject.jj97.feeds import *
from lvproject.jj97.models import *
from lvproject.jj97.jj97sitemap import *
from django.contrib.sitemaps import FlatPageSitemap, GenericSitemap

#feeds = {
#    'latest': LatestNews,
#    'categories': LatestNewsByCategory,
#}

feeds = {
    'rss': RssSiteNewsFeed,#NewsFeed
    'atom': AtomSiteNewsFeed,
}

info_dict = {
    'queryset': SiteNews.objects.all(),
    'date_field': 'createdate',
}

sitemaps = {
    'news': NewsSitemap(),
    'failed':FailedSitemap(),
}

urlpatterns = patterns('',
    (r'^$','lvproject.jj97.views.sitehome'),
    (r'^inlinegoogle/$','lvproject.jj97.views.inlinegoogle'), 
    #(r'^newsdetail/(?P<newsid>\d+)/$','newsdetail')   
    (r'^newsdetail/(\d+)/$',NewsDetail()),
    (r'^feeds/(?P<url>.*)/$', 'django.contrib.syndication.views.feed', {'feed_dict': feeds}),
    (r'^sitemap.xml$', 'django.contrib.sitemaps.views.sitemap', {'sitemaps': sitemaps}),
    (r'^sitemap-(?P<section>.+)\.xml$', 'django.contrib.sitemaps.views.sitemap', {'sitemaps': sitemaps}),

    #(r'^rss/news/(\d+)/$',)

)
